//
//  HWContentCell.m
//  ParagraphString
//
//  Created by Lucy_Lee on 2017/1/19.
//  Copyright © 2017年 Lucy_Lee. All rights reserved.
//

#import "HWContentCell.h"
#import "HWNews.h"
#import "UIView+HWExt.h"

@interface HWContentCell ()

@property (nonatomic, strong) UILabel * titleTextLabel;

@property (nonatomic, strong) UILabel * contentTextLabel;

@end

@implementation HWContentCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.titleTextLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 15.f, Width - 30, 20)];
        self.titleTextLabel.font = [UIFont systemFontOfSize:14.f];
        [self addSubview:self.titleTextLabel];
        
        self.contentTextLabel = [[UILabel alloc]init];
        self.contentTextLabel.numberOfLines = 0;
        [self addSubview:self.contentTextLabel];
    }
    return self;
}

- (void)loadContent{

    HWNews *model = self.data;
    
    self.titleTextLabel.text = model.title;
    
    self.contentTextLabel.left           = 15.f;
    self.contentTextLabel.top            = 50.f;
    self.contentTextLabel.width          = Width - 30.f;
    self.contentTextLabel.attributedText = model.attributedContent;
    [self.contentTextLabel sizeToFit];


}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
